#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include"mystring.h"

void my_strlen_test(const char * str);
void my_countchar_test(const char * str,char* c);
void my_strupper_test(char * str);
void my_strchar_test(const char * str,char * c);
int
main(int argc,char * argv[]){

	//my_strlen_test(argv[1]);
	//my_countchar_test(argv[1],argv[2]);
	//my_strupper_test(argv[1]);
	my_strchar_test(argv[1],argv[2]);
	return 0;
}
void my_strlen_test(const char * str){

	int mylen = my_strlen(str);
	int len = strlen(str);
	if(mylen == len){
		printf("right\n");
	}else{
		printf("count length error\n");
	}
	printf("mylen=%d len=%d",mylen,len);
}
void my_countchar_test(const char * str,char * c){

	int countChar = my_countchar(str,*c);
	printf("%c count in %s, count=%d\n",*c,str,countChar);
}
void my_strupper_test(char * str){

	my_strupper(str);
	printf("strupper %s\n",str);
}
void my_strchar_test(const char * str,char * c){

	char * mypos = my_strchar(str,*c);
	char * pos = strchr(str,*c);
	if(*mypos == *pos){
		printf("right\n");
	}else{
		printf("call strchar has error\n");
	}
}
